<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php $gmDate =  gmdate('Y-m-d');?>
<?php foreach($this->categories as $item) :?>
        <url>
            <loc><?php echo  htmlentities($this->hurl(array(
                    'cat' => array('value' => $item['id'], 'seo' => $item['key_word']),
                    'controller' => 'catalog',
                    'action' => 'view'
                ), false, true), ENT_QUOTES, "UTF-8");?></loc>
            <lastmod><?php echo $gmDate; ?></lastmod>
            <changefreq><?php echo $this->changefreq['categories']; ?></changefreq>
            <priority><?php echo $this->priority['categories']; ?></priority>
        </url>
<?php  endforeach;?>
<?php foreach($this->products as $item) :?>
        <url>
            <loc><?php echo htmlentities($this->hurl(array(
                    'cat' => array('value' => $item['id'], 'seo' => $item['key_word']),
                    'controller' => 'catalog',
                    'action' => 'view'
                ), false, true), ENT_QUOTES, "UTF-8");?></loc>
            <lastmod><?php echo $gmDate; ?></lastmod>
            <changefreq><?php echo $this->changefreq['products']; ?></changefreq>
            <priority><?php echo $this->priority['products'] ;?></priority>
        </url>
<?php endforeach;?>
<?php foreach($this->pagesCats as $item) :?>
        <url>
            <loc><?php echo 
                $this->serverName . htmlentities($this->url(array('cat' => $item['link']), 'cms_category', true), ENT_QUOTES, "UTF-8");
            ?></loc>
            <lastmod><?php echo $gmDate; ?></lastmod>
            <changefreq><?php echo $this->changefreq['pages']; ?></changefreq>
            <priority><?php echo $this->priority['pages']; ?></priority>
        </url>
<?php endforeach;?>

<?php foreach($this->pages as $item) :?>
        <url>
            <loc><?php echo  $this->serverName .
                htmlentities($this->url(array('page' => $item['link']), 'cms_page', true), ENT_QUOTES, "UTF-8" );
            ?></loc>
            <lastmod><?php echo $gmDate; ?></lastmod>
            <changefreq><?php echo $this->changefreq['pages'];?></changefreq>
            <priority><?php echo $this->priority['pages'];?></priority>
        </url>
<?php endforeach;?>
</urlset>